/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd_registro_civil;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Earving
 */
@Entity
@Table(name = "comparecio")
@NamedQueries({
    @NamedQuery(name = "Comparecio.findAll", query = "SELECT c FROM Comparecio c"),
    @NamedQuery(name = "Comparecio.findByDComparecio", query = "SELECT c FROM Comparecio c WHERE c.dComparecio = :dComparecio"),
    @NamedQuery(name = "Comparecio.findByNombre", query = "SELECT c FROM Comparecio c WHERE c.nombre = :nombre"),
    @NamedQuery(name = "Comparecio.findByApp", query = "SELECT c FROM Comparecio c WHERE c.app = :app"),
    @NamedQuery(name = "Comparecio.findByApm", query = "SELECT c FROM Comparecio c WHERE c.apm = :apm"),
    @NamedQuery(name = "Comparecio.findByNacionalidad", query = "SELECT c FROM Comparecio c WHERE c.nacionalidad = :nacionalidad"),
    @NamedQuery(name = "Comparecio.findByEdad", query = "SELECT c FROM Comparecio c WHERE c.edad = :edad")})
public class Comparecio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "1d_comparecio")
    private Integer dComparecio;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "app")
    private String app;
    @Column(name = "apm")
    private String apm;
    @Basic(optional = false)
    @Column(name = "nacionalidad")
    private String nacionalidad;
    @Basic(optional = false)
    @Column(name = "edad")
    private int edad;
    @JoinColumn(name = "id_parentesco", referencedColumnName = "id_parentesco")
    @ManyToOne
    private Parentesco parentesco;
    @JoinColumn(name = "id_acta", referencedColumnName = "id_acta")
    @ManyToOne(optional = false)
    private Acta acta;

    public Comparecio() {
    }

    public Comparecio(Integer dComparecio) {
        this.dComparecio = dComparecio;
    }

    public Comparecio(Integer dComparecio, String nombre, String app, String nacionalidad, int edad) {
        this.dComparecio = dComparecio;
        this.nombre = nombre;
        this.app = app;
        this.nacionalidad = nacionalidad;
        this.edad = edad;
    }

    public Integer getDComparecio() {
        return dComparecio;
    }

    public void setDComparecio(Integer dComparecio) {
        this.dComparecio = dComparecio;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getApm() {
        return apm;
    }

    public void setApm(String apm) {
        this.apm = apm;
    }

    public String getNacionalidad() {
        return nacionalidad;
    }

    public void setNacionalidad(String nacionalidad) {
        this.nacionalidad = nacionalidad;
    }

    public int getEdad() {
        return edad;
    }

    public void setEdad(int edad) {
        this.edad = edad;
    }

    public Parentesco getParentesco() {
        return parentesco;
    }

    public void setParentesco(Parentesco parentesco) {
        this.parentesco = parentesco;
    }

    public Acta getActa() {
        return acta;
    }

    public void setActa(Acta acta) {
        this.acta = acta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dComparecio != null ? dComparecio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Comparecio)) {
            return false;
        }
        Comparecio other = (Comparecio) object;
        if ((this.dComparecio == null && other.dComparecio != null) || (this.dComparecio != null && !this.dComparecio.equals(other.dComparecio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bd_registro_civil.Comparecio[dComparecio=" + dComparecio + "]";
    }

}
